

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>设置我的资料</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <!--引入本地的css样式-->
  <link rel="stylesheet" href="../../../static/layui/css/layui.css" media="all">
  <!--<link rel="stylesheet" href="../../../static/css/admin.css" media="all">-->

</head>
<body>

  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-form" lay-filter="myform">

              <div class="layui-form-item">
                <label class="layui-form-label">员工姓名:</label>
                <div class="layui-input-inline">
                  <!--显示用户名称：但是显示的input被禁用了，所以待会儿提交表单无法带参数，所以还得搞一个隐藏域来传递-->
                  <input type="text" name="username"  readonly disabled class="layui-input layui-disabled">
                </div>
                <label class="layui-form-label">员工编号:</label>
                <div class="layui-input-inline">
                  <input type="text" name="name_num" lay-verify="name_num" autocomplete="off" class="layui-input" readonly disabled>
                </div>
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label">所在部门:</label>
                <div class="layui-input-inline">
                  <input type="text" name="depart_name" lay-verify="depart_name" autocomplete="off" class="layui-input" readonly disabled>
                </div>
                <label class="layui-form-label">当前状态:</label>
                <div class="layui-input-inline">
                  <input type="text" name="status" lay-verify="status" autocomplete="off" class="layui-input" readonly disabled templet="#statusTpl">
                </div>
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label">系统角色:</label>
                <div class="layui-input-inline">
                  <input type="text" name="role_name" lay-verify="role_name" autocomplete="off" class="layui-input" readonly disabled>
                </div>
                <label class="layui-form-label">创建时间:</label>
                <div class="layui-input-inline">
                  <input type="text" name="ctime" lay-verify="ctime" autocomplete="off" class="layui-input" readonly disabled>
                </div>
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label">登录ID:</label>
                <div class="layui-input-inline">
                  <input type="text" name="loginid" lay-verify="loginid" autocomplete="off" class="layui-input" readonly disabled>
                </div>
                <label class="layui-form-label">联系方式:</label>
                <div class="layui-input-inline">
                  <input type="text" name="tel" lay-verify="tel" autocomplete="off" class="layui-input" readonly disabled>
                </div>
              </div>

                </div>
              </div>
            </div>
            
          </div>
        </div>
      </div>
    </div>
  </div>

  <script type="text/javascript" src="../../../static/js/jquery-3.6.0.min.js"></script>
  <!--引入本地layui.js-->
  <script src="../../../static/layui/layui.js"></script>
  <script type="text/html" id="statusTpl">
    {{#  if(d.status == 1){ }}
    <span>启用</span>
    {{#  } else if(d.status == 2){ }}
    <span>禁用</span>
    {{#  } }}
  </script>
  <script type="text/javascript">
      layui.use(['form', 'layedit', 'laydate','upload','element'], function() {
          var form = layui.form
              , layer = layui.layer
              ,upload = layui.upload
              ,element = layui.element
              , layedit = layui.layedit
              , laydate = layui.laydate;

          //json字符串
          var obj = sessionStorage.getItem("user");
          if(obj != null){
              //将json字符串转换为普通js对象，目的：js对象，可以直接打点调用取值
              var user = JSON.parse(obj);
              //页面加载，就应该去sessionStorage获取登录成功账户的信息，塞入到对应编辑输入框
              form.val('myform', {
                  "username": user.username // "name": "value"
                  ,"name_num": user.name_num
                  ,"depart_name":user.department_name
                  ,"status":user.status
                  ,"loginid":user.username
                  ,"ctime":user.update_time
                  ,"role_name":user.role_name
                  ,"tel": user.tel
              });
          }
      });
  </script>

  <script>

  </script>


</body>
</html>